<?php
	// Lấy mã sách từ thanh địa chỉ
	$id = $_GET['id'];
	
	$vanbanden = new vanbandenbs();
	$vanbanden->MaVanBanDen = $id;
	$dsvanban = $vanbanden->GetList();
	
	$SovaKyHieu = $dsvanban[0]['SovaKyHieu'];
	$dir = "data/".preg_replace('/[^a-zA-Z0-9]/','-',vn2latin($SovaKyHieu))."/";
	removeDir($dir); 
	$filevanban = new filevanbanbs();
	$filevanban->MaVanBanDen =  $id;
	$kqfile = $filevanban->DeleteVanBanDen();
	$kq = $vanbanden->Delete();
	if($kq)
	{
		header("Location: vanbanden");
	}
	else
	{
		ThongBaoLoi("Xóa thất bại");
	}
?>